home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / CHG_MOD.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  1KB  |  46 lines

  1. ;    DESC:    Changes the mode of a file                           V1.00
  2. ;        (ie archived, hidden, system)
  3. ;    IN:    *{SEG_VAL} segment and
  4. ;        *{OFFSET} offset of filename
  5. ;        *{FUNC_CODE} function code(1:set mode,0:get mode)
  6. ;        *{FILE_MODE} mode of file (1:read only,2:hidden file,
  7. ;         4:system file,8:volume label,10H:sub-directory,
  8. ;         20H:archived file
  9. ;    OUT:    *{CMODE} mode of file after completions of call
  10. ;    SAMPLE:    Callm    CHG_MOD,<SEG_VAL,OFFSET,FUNC_CODE,FILE_MODE>,<CMODE>
  11. ;    #################################################################### 
  12.  
  13.     Extrn    PUSHALL:Near
  14.     Extrn    POPALL:Near
  15.     Extrn    ERRORMSG:Near
  16.  
  17. CHG_MODC    Segment
  18.     Assume    CS:CHG_MODC
  19.     Public    CHG_MOD
  20.  
  21.                         ;notice.
  22.     DB    'CHG_MOD  - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  23.  
  24. CHG_MOD    Proc    Near                ;changes the mode of a file.
  25.     Call    PUSHALL
  26.  
  27.     Pop    CX                ;get new attribute.
  28.     Pop    AX                ;get function code.
  29.     Pop    DX                ;get filename offset.
  30.     Pop    DS                ;get segment offset.
  31.  
  32.     Mov    AH,43H                ;changes the mode of  a file.
  33.     Int    21H
  34.     Jc    ERROR                ;if error, report it.
  35.  
  36.     Push    CX                ;return attribute if any.
  37.     Call    POPALL
  38.     Ret
  39.  
  40. ERROR:    Push    AX                ;report error and abort.
  41.     Call    ERRORMSG
  42.  
  43. CHG_MOD    Endp
  44. CHG_MODC    Ends
  45.     End
  46.